
#ifndef __IOCP_FILE_IO_H__
#define __IOCP_FILE_IO_H__

#include "iocpbase.h"
#include "option.h"

#ifdef __cplusplus
extern "C" {
#endif

    void fileio_free(HIOCPFILE hObject);
    HIOCPFILE fileio_reference(HIOCPFILE hObject);
    long fileio_increment(HIOCPFILE hObject);
    long fileio_decrement(HIOCPFILE hObject);

    void fileio_set_name(HIOCPFILE hObject, LPCTSTR strFileName);
    LPCTSTR fileio_get_name(HIOCPFILE hObject);
    void fileio_set_userdata(HIOCPFILE hObject, void * pUserData);
    void * fileio_get_userdata(HIOCPFILE hObject);

    BOOL fileio_work_in_loop(HIOCPFILE hObject);
    HIOCPBASE fileio_get_iobase(HIOCPFILE hObject);

    BOOL fileio_set_read_watermark(HIOCPFILE hObject, unsigned int uVal);
    unsigned int fileio_get_read_watermark(HIOCPFILE hObject);
    BOOL fileio_set_write_watermark(HIOCPFILE hObject, unsigned int uVal);
    unsigned int fileio_get_write_watermark(HIOCPFILE hObject);

    BOOL fileio_set_max_readbuf(HIOCPFILE hObject, unsigned int uSize);
    BOOL fileio_set_max_writebuf(HIOCPFILE hObject, unsigned int uSize);
    unsigned int fileio_get_max_readbuf(HIOCPFILE hObject);
    unsigned int fileio_get_max_writebuf(HIOCPFILE hObject);
    unsigned int fileio_get_input_lenght(HIOCPFILE hObject);
    unsigned int fileio_get_output_lenght(HIOCPFILE hObject);

    void fileio_set_readtime(HIOCPFILE hObject, time_t tiVal);
    time_t fileio_get_readtime(HIOCPFILE hObject);
    void fileio_set_writetime(HIOCPFILE hObject, time_t tiVal);
    time_t fileio_get_writetime(HIOCPFILE hObject);

    BOOL fileio_set_read_timeout(HIOCPFILE hObject, DWORD dwTimeOut);
    DWORD fileio_get_read_timeout(HIOCPFILE hObject);
    BOOL fileio_set_write_timeout(HIOCPFILE hObject, DWORD dwTimeOut);
    DWORD fileio_get_write_timeout(HIOCPFILE hObject);

    BOOL fileio_set_read_level(HIOCPFILE hObject, DWORD dwLevel);
    DWORD fileio_get_read_level(HIOCPFILE hObject);
    BOOL fileio_set_write_level(HIOCPFILE hObject, DWORD dwLevel);
    DWORD fileio_get_write_level(HIOCPFILE hObject);

#ifdef __cplusplus
};
#endif


#endif